import {useResize} from './useResize'

function App() {
  // 需求：表格宽度随浏览器的宽度相应变化
  const [width] = useResize()
  return (
    <div className="App">
      <table border={1} style={{ width:width }}>
        <thead>
          <tr>
            <th>ID</th>
            <th>名称</th>
            <th>单价</th>
            <th>数量</th>
            <th>小计</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>1</td>
            <td>手机</td>
            <td>100</td>
            <td>20</td>
            <td>2000</td>
          </tr>
        </tbody>
      </table>
    </div>
  );
}

export default App;
